/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ShaderViewer.java
 *
 * Created on Jan 19, 2010, 9:41:03 AM
 */

package dae.fxcreator.ui;

import dae.fxcreator.io.codegen.ExportTask;
import java.io.File;

/**
 *
 * @author Koen
 */
public class ShaderViewer extends javax.swing.JPanel {
    private ExportTask model;
    /** Creates new form ShaderViewer */
    public ShaderViewer() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tabSourceCode = new javax.swing.JTabbedPane();

        tabSourceCode.setTabPlacement(javax.swing.JTabbedPane.LEFT);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tabSourceCode, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tabSourceCode, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    public void setExportTask(ExportTask task){
        this.model = task;
        tabSourceCode.removeAll();
        for (File file : model.getFiles()){
            ShaderSource ss = new ShaderSource();
            ss.showFile(file);
            tabSourceCode.addTab(file.getName(),null,ss,file.getPath());
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane tabSourceCode;
    // End of variables declaration//GEN-END:variables

}
